package com.connection.second.wallpaper.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;
import com.connection.second.wallpaper.mapper.PaperHomeBannerMapper;
import com.connection.second.wallpaper.domain.entity.PaperHomeBanner;
import com.connection.second.wallpaper.service.IPaperHomeBannerService;

/**
 * 首页海报管理Service业务层处理
 * 
 * @author FL
 * @date 2024-11-15
 */
@Service
public class PaperHomeBannerServiceImpl implements IPaperHomeBannerService 
{
    @Autowired
    private PaperHomeBannerMapper paperHomeBannerMapper;

    /**
     * 查询首页海报管理
     * 
     * @param id 首页海报管理主键
     * @return 首页海报管理
     */
    @Override
    public PaperHomeBanner selectPaperHomeBannerById(Long id)
    {
        return paperHomeBannerMapper.selectPaperHomeBannerById(id);
    }

    /**
     * 查询首页海报管理列表
     * 
     * @param paperHomeBanner 首页海报管理
     * @return 首页海报管理
     */
    @Override
    @Cacheable(value = "paperHomeBanner", key = "'selectPaperHomeBannerList'+#paperHomeBanner.toString()")
    public List<PaperHomeBanner> selectPaperHomeBannerList(PaperHomeBanner paperHomeBanner)
    {
        return paperHomeBannerMapper.selectPaperHomeBannerList(paperHomeBanner);
    }

    /**
     * 新增首页海报管理
     * 
     * @param paperHomeBanner 首页海报管理
     * @return 结果
     */
    @Override
    public int insertPaperHomeBanner(PaperHomeBanner paperHomeBanner)
    {
        return paperHomeBannerMapper.insertPaperHomeBanner(paperHomeBanner);
    }

    /**
     * 修改首页海报管理
     * 
     * @param paperHomeBanner 首页海报管理
     * @return 结果
     */
    @Override
    public int updatePaperHomeBanner(PaperHomeBanner paperHomeBanner)
    {
        return paperHomeBannerMapper.updatePaperHomeBanner(paperHomeBanner);
    }

    /**
     * 批量删除首页海报管理
     * 
     * @param ids 需要删除的首页海报管理主键
     * @return 结果
     */
    @Override
    public int deletePaperHomeBannerByIds(Long[] ids)
    {
        return paperHomeBannerMapper.deletePaperHomeBannerByIds(ids);
    }

    /**
     * 删除首页海报管理信息
     * 
     * @param id 首页海报管理主键
     * @return 结果
     */
    @Override
    public int deletePaperHomeBannerById(Long id)
    {
        return paperHomeBannerMapper.deletePaperHomeBannerById(id);
    }
}
